// test/factories.js
"use strict";

const { factory } = require("factory-girl");

module.exports = (app) => {
  // 可以通过 app.factory 访问 factory 实例
  app.factory = factory;

  // 定义 user 模型和默认数据
  factory.define("user", app.model.User, {
    name: factory.sequence("User.name", (n) => `name_${n}`),
    age: 18,
    gender: "male",
    phone: factory.sequence("User.phone", (n) => `phone_${n}`),
    address: "address",
    createdAt: new Date(),
    updatedAt: new Date(),
  });
};
